package com.tengju.support.domain.model.wx;

import lombok.AllArgsConstructor;
import org.springframework.util.StringUtils;

@AllArgsConstructor
public enum WechatUserStatus {

    ACTIVATION(1, "激活"),
    DISABLE(2, "已禁用"),
    NOT_ACTIVATION(4, "未激活"),
    RESIGN(5, "退出企业"),
    SPECIAL(99, "特殊账号"),
    ;

    Integer val;
    String desc;

    public Integer getVal() {
        return val;
    }

    public String getDesc() {
        return desc;
    }

    public static WechatUserStatus fromVal(Integer val) {
        if (StringUtils.isEmpty(val)) {
            return null;
        }
        for (WechatUserStatus status : values()) {
            if (status.val.equals(val)) {
                return status;
            }
        }
        return null;
    }

}
